let greetings = {
  hello: 'Bonjour!'
}

function fun(options) {
  return 'greetings.hello'.split('.').reduce((o,i) => {
    console.log(o, i, o[i]);
    if (o) return o[i]
  }, options)
}

console.log(fun({
  greetings: {
    hello: 'Bonjour!'
  }
}));